Skip to content

Refactor viz code + transform keypoints + integrated keypoint viz code#273

Open
ElmoPA wants to merge 1 commit intomainfrom
elmo/keypoint-transform-list
Open

Refactor viz code + transform keypoints + integrated keypoint viz code#273
ElmoPA wants to merge 1 commit intomainfrom
elmo/keypoint-transform-list

Conversation

@ElmoPA
Copy link
Contributor

@ElmoPA ElmoPA commented Mar 8, 2026

No description provided.

@ElmoPA ElmoPA marked this pull request as ready for review March 8, 2026 18:28
Copy link
Contributor Author

ElmoPA commented Mar 8, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@SimarKareer SimarKareer force-pushed the elmo/keypoint-transform-list branch from cf7f480 to f9e76cd Compare March 17, 2026 19:53
Comment on lines +425 to +426
Reshape(
input_key=left_keypoints_action_headframe,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you allow reshape to take in a list of reshapes to do. smth like
Reshape(
[(input_key, output_key, shape), (input_key2, output_key2, shape2)]
)

def viz_transformed_batch(
cls,
batch,
mode=Literal["traj", "axes", "keypoints"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this literal thing?

cls,
images,
actions,
mode=Literal["traj", "axes", "keypoints"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

batch[key] = batch[key].clone()
else:
raise ValueError(f"NumpyToTensor expects key '{key}' to be a numpy array or torch tensor, got {type(batch[key])}")
raise ValueError(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix formatting diff, did you run ruff in precommit?

if self.transform:
for transform in self.transform or []:
try:
# breakpoint()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm breakpoint

data = transform.transform(data)
except Exception as e:
logger.error(f"Error transforming data: {e}")
logger.error(f"Data: {data}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why'd you get rid of this?

]
},
{
"cell_type": "code",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the keypoint viz in this notebook to use your new functions

@@ -0,0 +1,420 @@
{
"cells": [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Make sure this notebook runs
  2. Update it to use your new viz code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants